
<script type="text/javascript">
    function secBoard3(n,url)
{
    var leg=document.getElementById('naa-table').getElementsByTagName('li').length;
    for(i=0;i<leg;i++)
    
    var mainleg=document.getElementById('tabb-content').getElementsByTagName('div').length;
    for(i=0;i<mainleg;i++)
    document.getElementById('tabb-content').getElementsByTagName('div')[i].style.display="none";
    document.getElementById('tabb-content').getElementsByTagName('div')[n].style.display="block";
    for(var id = 0; id <6; id++) {        
          if (id == n) {                                
            document.getElementById("mynav" + id).className= "hover";     
          } else {        
            document.getElementById("mynav" +  id).className = "article_golink "; 
          } 
     }     
    return false;

}
 function checkLogin()
 {
     alert('您还没有登陆');
     return false;
 }
</script>
 <style type="text/css">
  tbody th { 
 font-weight: normal;
 background: none repeat scroll 0 0 #EEEEEE;
 border: 1px solid #DDDDDD;
 font-size: 13px;
 font-weight: bold;
 border-left-style:none;
     border-bottom-style:none;
 padding: 5px;
 }
 #mytable td{
     border-right-style:none;
     border-bottom-style:none
 }
.hover{  background-color:#0099FF;  color: #003466   } 
 .article_golink{color:#003466;font-weight:bold;   }
 </style>
<?php 
        $courseid = $_GET['courseid'];
        if($courseid !='')
        {
            $sql_add  = " update nettteach_course set times=times+1 where id = ".$courseid;
            $db ->query($sql_add);
        }
        
        $sql_course = "select * from nettteach_course where id = ".$courseid;
        $result_course = $db ->query($sql_course);
        while($row_course = $db ->fetch_array($result_course))
        {
                
?>
<div id="sidebar_left">
			<dl>
				<dt>
					<a href="#"><?php echo(fs_get_objinfo('nettteach_course', 'id', $courseid,'title'))?></a>
				</dt>
				<dd  style="height:450px">
					<ul id="naa_table">
                        <li  id="mynav0" class="hover" onclick='return secBoard3(0)'>
                            <a id="mynav0" class="article_golink"  href="#"  >课程介绍</a> 
                        </li>
                        <li id="mynav1" onclick='return secBoard3(1)'>
                            <a id="mynav1" class="article_golink" href="#"  >教学大纲</a> 
                        </li>
                        <li id="mynav2" onclick='return secBoard3(2)'>
                            <a id="mynav2" class="article_golink" href="#"  >教学日历</a> 
                        </li>
                        <li id="mynav3" onclick='return secBoard3(3)'>
                            <a id="mynav3" class="article_golink" href="#" >教学信息</a> 
                        </li>
                        <li id="mynav4" onclick='return secBoard3(4)'>
                            <a id="mynav4" class="article_golink" href="#" >教学视频</a> 
                        </li>
                        <li id="mynav5" onclick='return secBoard3(5)'>
                            <a id="mynav5" class="article_golink" href="#">课后练习</a> 
                        </li>
<!--                        <li>
                            <a class="article_golink" href="?do=doexercise&courseid=<?php echo $_GET['courseid'];?>&tid=<?php echo $row_course['teacherid']; ?>" style="color:blue">课后练习</a> 
                        </li>-->
					</ul>
                    <div style="font-weight:bold;font-size:14px;"><a href="">返回</a></div>
				</dd>
			</dl>
</div>
<div id="sidebar_center" style="width: 735px">
	<!--left begin-->
            <dl class="box1" style="height: 100%;width: 735px;margin-top: 0;margin-bottom: 5px;">
                <dd>
                        <ul id="naa-table" >
                                <li   onclick='return secBoard3(0)'><a class="article_golink" href="#"> </a></li>
                                <li onclick='return secBoard3(1)'><a class="article_golink" href="#"> </a></li>
                                <li onclick='return secBoard3(2)'><a class="article_golink" href="#"> </a></li>
                                <li onclick='return secBoard3(3)'><a class="article_golink" href="#"> </a></li>
                                <li onclick='return secBoard3(4)'><a class="article_golink" href="#"> </a></li>
                                <li onclick='return secBoard3(5)'><a class="article_golink" href="#"> </a></li>
                                <li onclick='return secBoard3(6)'><a class="article_golink" href="#"> </a></li>
                        </ul>	
                </dd>
                <dd id="tabb-content" style="width:735px;">
                      
                    <div class="course_content" >
                        <h3>课程介绍:</h3> <br>
							<?php echo($row_course['introduction'])?>
					</div>
                    <div class="course_content" style="display:none; ">
                        <h3>教学大纲:</h3> <br>
							<?php echo($row_course['outline'])?>
					</div>
                    <div class="course_content" style="display:none; ">
                        <h3>教学日历:</h3> <br>
							<?php echo($row_course['calendar'])?>
					</div>
                    <div class="course_content" style="display:none;width: 735px;padding: 0;margin: 0;">
                        <h3>教学信息:</h3> <br>
                        <table id="mytable" width="100%"　border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse; line-height:30px;letter-spacing:5px;font-size: 15px;padding-bottom: 20px">

                            <tr>
                                <th>主讲教师:</th>
                                <td><?php echo(fs_get_objinfo('nettteach_member', 'id', $row_course['teacherid'],'realname'))?></td>
                            </tr>
                            <tr>
                                <th>任课专业:</th>
                                <td><?php echo(fs_get_departname($row_course['teacherid']).'/'.fs_get_majorname($row_course['teacherid']));?></td>
                            </tr>
                            <tr>
                                <th>联系电话:</th>
                                <td><?php echo(fs_get_objinfo('nettteach_member', 'id', $row_course['teacherid'],'tel'))?></td>
                            </tr>
                            <tr>
                                <th>QQ:</th>
                                <td><?php echo(fs_get_objinfo('nettteach_member', 'id', $row_course['teacherid'],'qq'))?></td>
                            </tr>
                            <tr>
                                <th>Email:</th>
                                <td><?php echo(fs_get_objinfo('nettteach_member', 'id', $row_course['teacherid'],'email'))?></td>
                            </tr>
                            <tr>
                                <th>照片:</th>
                                <td><?php $photo= fs_get_objinfo('nettteach_member', 'id', $row_course['teacherid'],'photo'); if($photo!='NULL' && $photo!=''){echo '<img style="margin-left:40px" width="90" src="backstage/'.$photo.'" />'?>
                                    <?php }else{echo "未上传照片";}?>
                                </td>
                            </tr>
                        </table>
                    </div>
                        <div style="display:none;" >
                            <dl class="" style="height: 100%">
                                <dt class=" news_nav article_golink " style="height: 100%;">
                                         <?php echo(fs_get_objinfo('nettteach_member', 'id', $row_course['teacherid'],'realname'))?>&nbsp;&nbsp;&nbsp;&nbsp;老师的视频 				
                                </dt>
                                <dd id="">
                                    <ul style="display:block;padding: 0px ">
                                            <table border="0" style="border-left-style: none;border-right-style: none;border-bottom-style: none;" cellpadding="0" cellspacing="0" class="breadcrumb" align="center" width="735px">
                                                <tr align="center">
                                                    <thead>
                                        <th style="line-height:2em;" nowrap>序号</th>
                                                        <th nowrap>缩略图</th>
                                                        <th nowrap>标题</th>
                                                        <th nowrap>简介</th>
<!--                                                        <td nowrap>大小(M)</td>-->
                                                        <th nowrap>浏览次数</th>
                                                        <th nowrap>发布时间</th>
                                                        <th nowrap>操作</th></tr>
                                    </thead>    
                                                    
                                                <?php 
                                                         $sql_videos = "select * from nettteach_videos where belonger = '".$row_course['teacherid']."'and state ='0' order by intotime  ";
                                                         $result_videos = $db -> query($sql_videos);
                                                         $recordcount = $db -> num_rows($result_videos);
                                                         if($recordcount >0){
                                                                 while($row_videos=$db->fetch_array($result_videos))
                                                                {
                                                                         $i++;

                                                                ?>
                                                                <tr>
                                                                  <td  height=1 colspan=10 bgcolor="#CCCCCC" onMouseOver="bgColor='#FF8899'" onMouseOut="bgColor=' #CCCCCC'"></td>
                                                                </tr>
                                                                <tr  onMouseOver="bgColor='#FF8899'" onMouseOut="bgColor='FFFFFF'"  align="center" title="" style="height:120px">
                                                                        <td style="line-height:2em;width: 5%"><?php echo ($i)?></td>
                                                                        <td style="width: 15%"><a href="<?php echo ('teacher/'.$row_videos['photo'])?>"><img src="<?php echo ('teacher/'.$row_videos['photo'])?>" onerror= "javascript:this.src= 'teacher/uploadfiles/image/nopic.jpg ' "  width="90" border="0" alt=""> </a></td>
                                                                        <td style="width: 15%;padding-left: 1%;" title="<?php echo ($row_videos['title'])?>"><?php echo ($row_videos['title'])?> </td>
                                                                        <td style="width: 35%;padding-left: 2%;padding-right: 2%" title="<?php echo ($row_videos['introduction'])?>"><?php echo (sub_str($row_videos['introduction'],52))?> </td>
                <!--                                                        <td ><?php echo ($row_videos['size'])?> </td>-->
                                                                        <td style="width: 10%"><?php echo($row_videos['times'])?></td>  		
                                                                        <td style="width: 10%"><?php echo(date('Y-m-d',$row_videos['intotime']))?></td>	

                                                                        <td style="width: 10%"><a title="<?php echo($row_videos['title'])?>" class="btn btn-info" href="?do=viewvideos&video_id=<?php echo($row_videos['id'])?>" <?php if($_SESSION['sid']==''){ ?> onclick="return checkLogin()" <?php }?> >进入 »</a></td>
                                                                </tr>
                                                        <?php
                                                                }
                                                        }else{
                                                                    ?>
                                                        <tr    align="center" title="" style="height:50px;color: red;font-size: 15px;">
                                                                <td>暂无视频!</td>
                                                        </tr>
                                                        <?php
                                                                    }
                                                        ?>
                                            </table>

                                    </ul>
                                </dd>
                          </dl>
                        </div>
                    <div class=".exam_list1"  style="display:none;margin-top: 0;border-style: hidden;">
                            <dl class="" style="height: 100%">
                                <dt class=" news_nav article_golink " style="height: 100%;">
                                         <?php echo(fs_get_objinfo('nettteach_member', 'id', $row_course['teacherid'],'realname'))?>&nbsp;&nbsp;&nbsp;&nbsp;老师的题库 				
                                </dt>
                            <dd id="">
                                <ul style="display:block;padding-left:10px ;padding-right:10px ;width: 715px;">
                                <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                    <thead>
                                        <tr><th align="left" style="padding: 10px">试题名称</th><th>考试人数</th><th>操作</th></tr>
                                    </thead>
                                    <?php
                                        $exam_sql = "select * from ".DBPREFIX."exam  where exam_pubuid =".$row_course['teacherid']." and type=0 and is_exercise=1";
                                        $exam_result = $db -> query($exam_sql);
                                        $recordcount_exam = $db -> num_rows($exam_result);
                                        if($recordcount_exam > 0){
                                                while($exam_row = $db -> fetch_array($exam_result)){
                                                ?>
                                                <tbody>
                                                    <tr>
                                                        <td  height=1 width="90%" colspan=10 bgcolor="#CCCCCC" onMouseOver="bgColor='#FF8899'" onMouseOut="bgColor=' #CCCCCC'"></td>
                                                    </tr>
                                                    <tr valign="middle" style="height:40px">
                                                        <td width="60%" style="padding-left: 10px" ><a href="?do=examinfo&id="<?php echo $exam_row['exam_id']?>><?php echo $exam_row['exam_name']?></a></td>

                                                        <td width="20%" align="center"><?php echo $exam_row['exam_num']?></td>
                                                        <td width="20%" align="center" ><input type="button" <?php if($_SESSION['sid']==''){ ?> onclick="return checkLogin()" <?php }?> onclick="gotest(<?php echo $exam_row['exam_id'];?> )"   class="btn btn-info" value="进入 »" /></td>
                                                    </tr>
                                                </tbody>
                                                <?php 
                                                }
                                        }else{ ?>
                                               <tbody>
                                                    <tr valign="middle" style="height:50px;color: red;font-size: 15px;">
                                                        <td width="40%" >暂无练习题库!</td>
    </tr>
                                               </tbody> 
                                <?php }?>
                                </table>
                                     </ul>
                                </dd>
                          </dl>
                    </div>
				</dd>
         </dl>
</div>
<script type="text/javascript">
    function gotest(examid){
        window.location.href = '?do=exerciseinfo&ext=1&id='+examid;
    }
</script>
<?php
    }
    function fs_get_departname($i)
{
	if ( $i=='' || is_null($i) || !is_numeric($i))	{return '无';break;}
	global $db;
	$sql	=	"select nb.name as name from nettteach_department nb,nettteach_member nm where nm.id=$i and nm.departmentid = nb.id";
	$result =	$db -> query($sql);
	$row	=	$db -> fetch_array($result);
	return	$row['name'];
}
//根据专业ID返回专业名称 20120817qzr
function fs_get_majorname($i)
{
	if ( $i=='' || is_null($i) || !is_numeric($i))	{return '';break;}
	global $db;
	$sql	=	"select nb.name as name from nettteach_major nb,nettteach_member nm where nm.id=$i and nm.majorid = nb.id";
	$result =	$db -> query($sql);
	$row	=	$db -> fetch_array($result);
	return	$row['name'];
}
    
    ?>
          